package com.vivachek.protocol.converts

import com.vivachek.protocol.Parse
import com.vivachek.protocol.enums.UnitEnums


/**
 * @Author: YCB
 * @Time: 2022/9/26 18:40
 * @Email: congbin.yuan@vivachek.com
 * @Description: 解析设备单位
 *
 */
private const val COMMAND = 170
private const val EXPAND_CODE = 170
private const val LENGTH = 1
internal class UnitConvert : DataConvert(COMMAND, EXPAND_CODE,LENGTH) {

    override fun parse(data: List<Int>,origin:List<Int>) {
        val unit = UnitEnums.convert(data.first())
        Parse.unit = unit
        listener?.unit(unit)
    }
}